import { h } from 'vue';
import { Tag } from '@arco-design/web-vue';
import { BasicColumn } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '岗位编码',
    dataIndex: 'postCode',
  },
  {
    title: '岗位名称',
    dataIndex: 'postName',
  },
  {
    title: '排序',
    dataIndex: 'orderNum',
  },
  {
    title: '状态',
    dataIndex: 'isEnable',
    render(row) {
      return h(
        Tag,
        {
          type: row.isEnable ? 'success' : 'error',
        },
        {
          default: () => (row.isEnable ? '启用' : '禁用'),
        },
      );
    },
  },
  {
    title: '创建时间',
    dataIndex: 'createDate',
  },
];
